<?php
class WPaymentPagseguroAdminParams extends UParamsWorklet
{
	public function accessRules()
	{
		return array(
			array('allow', 'roles' => array('administrator')),
			array('deny', 'users'=>array('*'))
		);
	}
	
	public function title()
	{
		return;
	}
	
	public function properties()
	{
		return array(
			'elements' => array(
				$this->t('PagSeguro automatic return URL: {url}', array(
					'{url}' => aUrl('/payment/pagseguro/ipn'),
				)),
				'name' => array('type' => 'text', 'label' => $this->t('Name')),
				'business' => array('type' => 'text', 'label' => $this->t('Account Email Address')),
				'token' => array('type' => 'text', 'label' => $this->t('Security Token'), 'class' => 'large', 
					'hint' => $this->t('Please make sure that token value is identical here and in your PagSeguro account.')),
			),
			'buttons' => array(
				'submit' => array('type' => 'submit', 'label' => $this->t('Save'))
			),
			'model' => $this->model
		);
	}
}